import Vue from "vue";
import Vuex from "vuex";
import page1 from "./page1";
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // 面包屑导航
    brames: [],
    theme: window.localStorage.getItem("editor3d_theme") || "light",
  },
  mutations: {
    // 设置当前项目的id
    setBrames(state, val) {
      state.brames = val;
    },
    // 设置主题主题色
    setTheme(state, value) {
      document.documentElement.dataset.theme = value;
      window.localStorage.setItem("editor3d_theme", value);
      state.theme = value;
    },
  },
  mapActions: {},
  modules: {
    page1,
  },
});
